from google.appengine.api import users

from model.user import User

class Application:
    """
    The base controller init mixin
    """
    def application_init(self):
        """
        default initialization method invoked by dispatcher
        """
        self.account = users.get_current_user()
        self.user = None

        if self.account is not None:
            self.user = User.gql('WHERE account = :1', self.account).get()
